/**
 * 
 */
package com.eagle.coders.security.transaction.beans;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;


@Embeddable
public class UserGroupLimitPK implements Serializable {
    
	private static final long serialVersionUID = 1L;

	private String groupCode;
    
    private Integer groupLevel;
    
    private String moduleCode;
    
    private String currencyCode;
    
    public UserGroupLimitPK(){
        
    }
    
    public UserGroupLimitPK(String groupCode, Integer groupLevel,String moduleCode,
                            String currencyCode){
        
        this.groupCode = groupCode;
        this.groupLevel = groupLevel;
        this.moduleCode = moduleCode;
        this.currencyCode = currencyCode;
        
    }
    
    @Column(name="FCCD", nullable = false)
    public String getCurrencyCode() {
        return currencyCode;
    }

    public void setCurrencyCode(String currencyCode) {
        this.currencyCode = currencyCode;
    }
    
    @Column(name="GRP_CD", nullable = false)
    public String getGroupCode() {
        return groupCode;
    }

    public void setGroupCode(String groupCode) {
        this.groupCode = groupCode;
    }
    
    @Column(name="GRP_LVL", nullable = false)
    public Integer getGroupLevel() {
        return groupLevel;
    }

    public void setGroupLevel(Integer groupLevel) {
        this.groupLevel = groupLevel;
    }
    
    @Column(name="MOD_CD", nullable = false)
    public String getModuleCode() {
        return moduleCode;
    }

    public void setModuleCode(String moduleCode) {
        this.moduleCode = moduleCode;
    }
    
    public boolean equals(Object other) {
        boolean areEqual = false;
        if (other instanceof UserGroupLimitPK) {
            final UserGroupLimitPK otherGroupLimitPK = (UserGroupLimitPK) other;
            areEqual = (otherGroupLimitPK.currencyCode.equals(currencyCode)
                    && otherGroupLimitPK.groupCode.equals(groupCode) && otherGroupLimitPK.groupLevel
                    .equals(groupLevel) && otherGroupLimitPK.moduleCode.equals(moduleCode));
        }
        return areEqual;
    }

    public int hashCode() {
        int hashCode = 31 * (this.groupCode.hashCode() + this.groupLevel.hashCode() +
                        this.currencyCode.hashCode() + this.moduleCode.hashCode());
        return hashCode;
    }
    
    

}
